#include <QApplication>
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QtQml>
#include "dealfilemanger.h"
#include "qmltableview.h"
#include "filewatch.h"
#include "readfile.h"

int main(int argc, char *argv[])
{
//    QGuiApplication app(argc, argv);
    QApplication app(argc, argv);

    QQmlApplicationEngine engine;

    QmlTableView model;

    ReadFile file;

    QObject::connect(&file, &ReadFile::sigShowResult, &model, &QmlTableView::sltAppendData);

    qmlRegisterType<DealFileManger>("DealFileMangerModel",1,0,"DealFileManger");

    engine.rootContext()->setContextProperty("theModel",&model);
    engine.rootContext()->setContextProperty("readFile",&file);

    engine.load(QUrl(QStringLiteral("qrc:/main.qml")));



    return app.exec();
}

